/*
 * Written by Rossi Kamal
 * Date 2011.01.06
 * 
 */

package net.m2m.policycompiler.smartdevice.smartphone.translation;

import java.beans.XMLEncoder;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;

public class NetworkConfigurationTranslate {
	
	public static void main(String args[]){
		
		NetworkConfigurationTranslate netCfgTra=new NetworkConfigurationTranslate(1,"192.168.10.1","Strict","Good");
		
		
	}
	
	public NetworkConfigurationTranslate(int a,String b, String c, String d) {
	
		try {

			
			NetworkConfigration netCfg=new NetworkConfigration();
			netCfg.setM2MNetworkConfigurationID(a);
			netCfg.setM2MNetworkAddress(b);
			netCfg.setM2MConfigurationRequirement(c);
			netCfg.setM2MNetConfigCommen(d);
			
			
			
			XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(
					new FileOutputStream("/home/moons/workspace/M2M/policy_xml/smartdevice/smartphone/3g/netconfig.xml")));
			encoder.writeObject(netCfg);
			encoder.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
		
}


